package isc.whu.defender.common;

import isc.whu.defender.netmonitor.MonitorActivity;

import java.util.HashMap;

import android.Manifest.permission;
import android.content.Context;
import android.content.SharedPreferences;

public class CommonTools {
	public static HashMap<String, Object> SensitivePermissionsMap = new HashMap<String, Object>();
	
	static {
		SensitivePermissionsMap.put(permission.WRITE_SMS, 1);
		SensitivePermissionsMap.put(permission.SEND_SMS, 2);
		SensitivePermissionsMap.put(permission.READ_PHONE_STATE, 2);
		SensitivePermissionsMap.put(permission.PROCESS_OUTGOING_CALLS, 5);
		SensitivePermissionsMap.put(permission.RECORD_AUDIO, 5);
	}
	
	public static final String PREF_FILE_NAME = "global_preference";
	
	public static SharedPreferences getPreferences(Context context) {
		return context.getSharedPreferences(PREF_FILE_NAME, 0);
	}
	
	public static final int THRESHOLD = 12;

}
